/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.viajaconmigo.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Pablo
 */
@Embeddable
public class AportePK implements Serializable {
    
    @Basic(optional = false)
    @Column(name = "id_aporte")
    private int idAporte;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "orden")
    private short orden;

    public AportePK() {
    }

    public AportePK(int idAporte, short orden) {
        this.idAporte = idAporte;
        this.orden = orden;
    }

    public int getIdAporte() {
        return idAporte;
    }

    public void setIdAporte(int idAporte) {
        this.idAporte = idAporte;
    }

    public short getOrden() {
        return orden;
    }

    public void setOrden(short orden) {
        this.orden = orden;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idAporte;
        hash += (int) orden;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AportePK)) {
            return false;
        }
        AportePK other = (AportePK) object;
        if (this.idAporte != other.idAporte) {
            return false;
        }
        if (this.orden != other.orden) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.AportePK[ idAporte=" + idAporte + ", orden=" + orden + " ]";
    }
    
}
